package com.ubs.lingua.buildtool.cs;

import java.io.IOException;
import java.util.concurrent.Future;

import org.springframework.core.io.Resource;

import com.ubs.lingua.buildtool.cs.parameters.BuildParameters;

/**
 * Interface for the C# library builder singleton Spring bean.
 */
public interface CsBuilder {

    /**
     * <p>Starts asynchronous batch operation which builds C# library.
     * The following actions are performed:</p>
     * <ol>
     * <li>The source package located at <code>packagePath</code> containing C# source code and all dependencies
     * is unpacked into working directory.</li>
     * <li>Depending on the <code>parameters</code>, .NET assembly (or several assemblies), *.pdb file for use by debugging tools
     * and XML documentation are built.</li>
     * <li>All generated code items are packed into the ZIP archive.</li>
     * </ol>
     * <p>ZIP archive containing all generated code items can be obtained from the {@link Future} returned by this method.</p>
     * @param parameters the build batch parameters
     * @param packagePath the source package path
     * @return the {@link Future} which represents the result of the build batch
     * @throws InterruptedException when asynchronous thread was interrupted
     * @throws IOException when any there was any problem accessing file system resources
     * @see com.ubs.lingua.buildtool.cs.parameters.BuildParameters
     */
    Future<Resource> build(BuildParameters parameters, String packagePath) throws InterruptedException, IOException;

}
